package model.playingfield;

import java.awt.Color;

import model.Player;

/**
 * This is a BranchingSpot. It differs from an ordinary spot only in the sense
 * that it has an additional Spot reference (meant to refer to the first spot
 * on the home row for the player it is associated with).
 */
public class BranchingSpot extends Spot {

    private static final long serialVersionUID = 1L;

    private Spot nextRunwaySpot;

    /**
     * Constructs a new BranchingSpot for a given color and index.
     * @param color - Any Color object.
     * @param index - This spot's index.
     */
    public BranchingSpot(Color color, int index) {
        super(color, index);
    }

    /**
     * Constructs a new BranchingSpot for a given player and index.
     * @param player - A Player object
     * @param index  - This spot's index.
     */
    public BranchingSpot(Player player, int index) {
        super(player, index);
    }

    /**
     * Set the home row spot that this spot will branch into.
     * @param nextRunway
     */
    public void setNextRunway(Spot nextRunway) {
        this.nextRunwaySpot = nextRunway;
    }

    /**
     * Get the home row spot associated with this BranchingSpot.
     * @return
     */
    public Spot getNextRunway() {
        return this.nextRunwaySpot;
    }
}
